import { Message } from 'element-ui'
export const messageFn = (isSuccess, title) => {
  if (isSuccess) {
    return Message.success(`${title}成功`)
  } else {
    return Message.warning(`${title}失败`)
  }
}
export const myTree = (treeArr) => {
  treeArr.forEach(item => {
    if (!item.children || !item.children.length) {
      delete item.children
    }
    if (item.ownerId) {
      item.disabled = true
    }
    if (item.children) {
      myTree(item.children)
    }
  })
  return treeArr
}
